package au.com.langdale.gwt.client.remote;

import java.util.ArrayList;

import com.google.gwt.user.client.rpc.IsSerializable;

/**
 * A serializable container for model objects.<p>  
 * 
 * The contents member is a sequence of model
 * objects that may be a subsequence of some
 * larger, server-side sequence (e.g. a database
 * table).<p>
 * 
 * The first and quota members indicate the position
 * of contents within a larger sequence.<p>
 * 
 * The member, first, is the offset of contents 
 * in the larger sequence.<p>
 * 
 * If contents.size() &lt; quota then the length of the
 * larger sequence can be inferred as first + contents.size().<p>
 * 
 * @author adv
 *
 */
public class Batch implements IsSerializable {
	/**
	 * Serializable ctor.
	 *
	 */
	public Batch() {}
	
	/**
	 * Construct from contents.
	 */
	public Batch(ArrayList contents, int first, int quota) {
		this.contents = contents;
		this.first = first;
		this.quota = quota;
	}
	/**
	 * The payload of a batch consists of Models.
	 * 
	 * @gwt.typeArgs <au.com.langdale.gwt.client.model.Model>
	 */
	public ArrayList contents;
	public int first, quota;
}
